/* 引入项目路由 */
import VueRouter from "vue-router";

/* 引入页面组件 */
import MusicHome from '@/pages/music/MusicHome.vue'/* 首页 */
import MusicCate from '@/pages/music/MusicCate.vue'/* 歌单 */
import MusicStar from '@/pages/music/MusicStar.vue'/* 歌手 */
import MusicMine from '@/pages/music/MusicMine.vue'/* 我的 */
import NotFound from '@/pages/error/NotFound'/* 404 */
import MineWord from '@/pages/mine/MineWord'/* 用户作品 */
import MineCollect from '@/pages/mine/MineCollect'/* 用户收藏 */
import MineMusicList from '@/pages/mine/MineMusicList'/* 用户自定义歌单 */
import MineMsg from '@/pages/mine/MineMsg'/* 平台信息 */
import EditUserInfo from '@/pages/mine/EditUserInfo'/* 编辑用户资料 */
import BackLogin from '@/pages/back/BackLogin'/* 登录页 */
import BackHome from '@/pages/back/BackHome'/* 后台首页 */
import PlatformData from '@/pages/back/PlatformData'/* 后台 平台数据 */
import PlatformUser from '@/pages/back/PlatformUser'/* 后台 平台用户管理 */
import PlatformMusic from '@/pages/back/PlatformMusic'/* 后台 平台音乐管理 */
export default new VueRouter({
    routes: [
        /* 首页重定向 */
        { path: "/", redirect: "/index" },
        /* 首页 */
        { path: "/index", name: "index", component: MusicHome },
        /* 歌单 */
        { path: "/cate", name: "cate", component: MusicCate },
        /* 歌手 */
        { path: "/star", name: "star", component: MusicStar },
        /* 我的 */
        {
            path: "/mine", redirect: "/mine/work", name: "mine", component: MusicMine, children: [
                /* 作品 */
                { path: "work", name: "work", component: MineWord },
                /* 收藏 */
                { path: "collect", name: "collect", component: MineCollect },
                /* 平台消息 */
                { path: "message", name: "msg", component: MineMsg },
                /* 自定义歌单 */
                { path: "musiclist", name: "musiclist", component: MineMusicList },
                /* 编辑用户资料 */
                { path: "edit_user_info", name: "edit_user_info", component: EditUserInfo }
            ]
        },
        /* 后台 */
        {
            path: "/back", redirect: "/back/data", name: "backhome", component: BackHome, children: [
                /* 平台数据 */
                { path: "data", name: "platformdata", component: PlatformData },
                /* 平台用户 */
                { path: "user", name: "platformuser", component: PlatformUser },
                /* 平台音乐 */
                { path: "music", name: "platformmusic", component: PlatformMusic }
            ]
        },
        /* 登录页 */
        { path: "/login", name: "backlogin", component: BackLogin },
        /* 404 notfound */
        { path: "/404", name: "notfound", component: NotFound },
        /* 所有错误路径 都重定向 到404页面 */
        { path: "*", redirect: "/404" }
    ]
})